const express = require('express')
const app = express()
const init = require('./middleware/init')
const send = require('./middleware/send')
const filehandle = require('./middleware/file')

app.use(init)

app.use('*', (req, res, next)=>{
    console.log(req.url)
    req.sendObj.url.push(req.url)
    req.sendObj.name = '参数'
    next()
})

app.post('/file', filehandle)

// 响应结果结构封装
app.use(send)

app.listen(3005, ()=>console.log('服务启动成功：http:127.0.0.1:3005'))